package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.hmo.mall.utils.SpUtil;
import xhwl.retrofitrx.BaseApi;

/**
 * 确认收货
 */
public class ConfirmReceiptApi extends BaseApi {
    ConfirmReceiptReq req;

    public ConfirmReceiptApi(String buy_id) {
        req = new ConfirmReceiptReq(buy_id);
        setShowDialog(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).confirm_receipt(requestBody);
    }

    public class ConfirmReceiptReq {
        private String member_mobile;
        private String buy_id ;

        public ConfirmReceiptReq(String buy_id) {
            this.member_mobile = SpUtil.getString(SpUtil.MEMBER_MOBILE,"");;
            this.buy_id = buy_id;
        }
    }
}
